FACTOR
Factor integers into prime components.
----begin documentation----
Program:  FACTOR
Author:   John P. Powers (jpp@cpdvax.csc.ti.com)
Date:     July 13, 1992

This program produces a list of the prime factors of a given
integer.  The list is displayed in the form of factor/power pairs. 

Execute FACTOR to begin the program.  A prompt for the integer to
factor then appears:

  N=?

Enter an integer.  The integer's factors are then displayed.

For example, to factor 1584:

  FACTOR
  N=?1584
   {(2,4) (3,2) (11,1)}

The factors of 1584 are 2^4 * 3^2 * 11.
----end documentation----
----begin ascii----
\START\
\COMMENT=Program file dated 07/13/92, 09:24
\NAME=FACTOR
\FILE=factor.85P
RectC
0\->\dimL  FACTORS
Prompt  N
1\->\S
2\->\F
0\->\E
\sqrt\N\->\M
While  F\<=\M
While  mod(N,F)==0
E+1\->\E
N/F\->\N
End
If  E>0:Then
(F,E)\->\FACTORS(S)
0\->\E
S+1\->\S
\sqrt\N\->\M
End
If  F==2
Then:3\->\F
Else:F+2\->\F
End
End
If  N\<>\1:(N,1)\->\FACTORS(S)
FACTORS
\STOP\
----end ascii----
----begin uue----
begin 644 factor.85p
M*BI423@U*BH:#`!0<F]G<F%M(&9I;&4@9&%T960@,#<O,3,O.3(L(#`Y.C(T
M``"P*U!BEI+J``H`W``2!D9!0U1/4MP`V@!J;T0P``O`.49!0U1/4E-OYS-.
M;T0Q``LS4V]$,@`+,T9O1#``"S-%;Z`S3@LS36_;,T93,TUOVQ40,TXO,T81
M4$0P`&\S16!$,0`+,T5O,TYQ,T8+,TYOWF_8,T521#``;MEO$#-&+S-%$0LY
M1D%#5$]24Q`S4Q%O1#``"S-%;S-38$0Q``LS4V^@,TX+,TUOWF_8,T901#(`
M;]EN1#,`"S-&;]IN,T9@1#(`"S-&;]YOWF_8,TY51#$`;A`S3B]$,0`1"SE&
504-43U)3$#-3$6\Y1D%#5$]24_M!
`
end
----end uue----
